package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.arg.OriginalArg;
import com.azier.kapacitor.script.method.Quiet;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new node that samples the incoming points or batches.
**/
/**
创建一个新节点，以对传入的点或批次进行采样。
**/
public class SampleNode extends AbstractNode implements CommonNodeBind {
    private static final String name = "sample";

    public SampleNode(Object rate) {
        super(new ArrayList<>(),new ArrayList<>(),name);
        //
        this.args.add(new OriginalArg(rate));
    }

    /**
    Suppress all error logging events from this node.
    **/
    /**
    禁止来自此节点的所有错误记录事件。
    **/
    public SampleNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }
}